<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>demo</title>
<script src="../js/lib.js?v=11010956"></script>


<script type="text/javascript" src="/js/jquery.contenteditable.js??v=11010956"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>

<link rel="stylesheet" href="/js/jquery.contenteditable.css" type="text/css" />
<style type="text/css">
#draggable { width: 75px; height: 25px; background: blue; padding: 10px; }
#draggable1 { width: 75px; height: 25px; top: 30px; background: silver; padding: 10px; }
.block0 { position: absolute; width: 75px; height: 25px; background: green; padding: 10px; }
.block1 { position: absolute; width: 75px; height: 25px; background: green; padding: 10px; }
.block2 { position: absolute; width: 75px; height: 25px; background: green; padding: 10px; }
#droppable { position: absolute; left: 250px; top: 0; width: 500px; height: 800px; background: gray; color: white; padding: 10px; }




</style>

</head>
<body>


<div class="wrapper">
<!--div class="paper" id="droppable">this is the paper</div-->

<div id="draggable1" class="cmodule" sModuleName="text" rel="1">text</div>
<div id="draggable" class="cmodule" sModuleName="link" rel="2">link</div>
<input class="btn_post" id="iPub" type=button value="publish" style="margin-right:105px;"/>

<div type="hidden">
<form id="innerSubForm" action="/cgi-bin/auto_act/generate_page_all.cgi" method="post" enctype="application/x-www-form-urlencoded" target="demo_hidden_frame">
<input type="hidden" name="iPageId" id="iPageId" value=""/>
<input type="hidden" name="sDatas" id="sDatas" value=""/>
<input type="hidden" name="tpls" id="tpls" value=""/>
<iframe name="demo_hidden_frame" id="demo_hidden_frame" style="display:none"> </iframe>
</form>
</div>
<textarea id="commentText" name="comment"></textarea>

</div>

<textarea id="editor_id" name="content" style="width:700px;height:1300px;">
</textarea>
<script type="text/javascript" src="/js/itemMgr.js"></script>
<script type="text/javascript" src="/js/basePortal.js"></script>
<script charset="utf-8" src="/editor/kindeditor.js"></script>
<script charset="utf-8" src="/editor/lang/zh_CN.js"></script>
<script>
$(document).ready(function() {

	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('#editor_id');		
	});
		
	var para = {};
	para.pageId = 1;

	Module.ItemMgr.init(para);

	var opt = {};
	opt.paper = $(".paper");
	Module.ItemBusi.init(opt);

	$("#draggable").draggable({
		helper: 'clone',
		cursor: 'crosshair'
	});
	$("#draggable1").draggable({
		helper: 'clone',
		cursor: 'crosshair'
	});
	$("#iPub").click(function(){
		alert('pub');
		alert(editor.html());
		$("#iPageId").val(1);
		$("#sDatas").val(Module.ItemMgr.getAllItemString());		
		$("#innerSubForm").submit();	
	});




$("#droppable").droppable({   
	accept: '.cmodule',
	drop: function(ev, ui)
	{
		var sModuleName = $(ui.draggable).attr("sModuleName");
		Module.ItemBusi.onDrop(sModuleName, ev, ui);	
		
	}
});

});
</script>




</body>
</html>
